FROM node:8

MAINTAINER ilovintit <ilovintit@gmail.com>

RUN npm install pm2 -g

#部署代码
RUN mkdir -p /app
WORKDIR /app
COPY ./package.json /app/
COPY ./package-lock.json /app/
RUN npm install
COPY . /app
ENV NODE_ENV=production
ENV HOST=0.0.0.0
RUN npm run build

EXPOSE 3000

CMD ["pm2-runtime","/app/server.js"]
